<template>
  <view class="card discount_item">
    <text class="name">领取实体商品</text>
    <u-radio-group :value="isPost" placement="row" @change="groupChange">
      <u-radio v-if="isPrepaidRice" :name="true" labelSize="28rpx" activeColor="#de4141"
        :label="hasPaidByShipper ? '付寄' : '包邮'"></u-radio>
      <view v-else style="width: 60rpx;"></view>
      <u-radio activeColor="#de4141" labelSize="28rpx" :name="false" label="到店领取/施工"></u-radio>
    </u-radio-group>
  </view>
</template>

<script>
export default {
  name: 'PickupMethod',
  props: {
    isPost: {
      type: Boolean,
      default: true
    },
    hasPaidByShipper: {
      type: Boolean,
      default: false
    },
    isPrepaidRice: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    groupChange(v) {
      this.$emit('sendValue', v)
    }
  },
  beforeDestroy() {
    this.$emit('sendValue', true)
  }
}
</script>

<style lang='scss' scoped>
.card {
  width: 92%;
  padding: 10px;
  margin: 0 auto 30rpx;
  background-color: #fff;
  border-radius: 10rpx;
  box-shadow: $theme-shadow2;
}

.discount_item {
  display: flex;
  justify-content: space-between;
  line-height: 48rpx;

  .name {
    color: #222;
    font-weight: 600;
    font-size: 28rpx;
  }

  .num {
    color: #666;
    font-weight: 500;
    font-size: 28rpx;
  }
}
</style>